﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChurchDiary.TableEntity
{
    /// <summary>
    /// Applicant Details
    /// </summary>
    [Table("CH_ChurchMemberApplications")]
    public class EntityChurchMemberApplications : BaseEntity
    {
        [Key]
        public Guid ApplicationId { get; set; }
        public Guid NameTitleId { get; set; }
        public string Initial { get; set; }
        public string ApplicantFirstName { get; set; }
        public string ApplicantMiddleName { get; set; }
        public string ApplicantLastName { get; set; }
        public string PlaceOfChurch { get; set; }
        public string SinceWhen { get; set; }
        public string ReasonforSelecting { get; set; }
        public string PlaceAndChurch { get; set; }
        public string PreviousChurch { get; set; }
        public string ApplicationDate { get; set; }
        public string ApplicationPlace { get; set; }
        public string ApplicantPhoto { get; set; }
        public string ApplicantSoftCopy { get; set; }
        public int ApplicationNo { get; set; }

        public virtual EntityNameTitle NameTitle { get; set; }
        public virtual EntityChurch Church { get; set; }
        public virtual EntityChurchMemberFamily Family { get; set; }
    }
    /// <summary>
    /// Family Details
    /// </summary>
    [Table("CH_ChurchMemberFamily")]
    public class EntityChurchMemberFamily : BaseEntity 
    {
        [Key]
        public Guid FamilyId { get; set; }
        public Guid ApplicationId { get; set; }
        public int FamilyNo { get; set; }
        public Guid Churchid { get; set; }
        public Guid CurrentStatusId { get; set; }
        public string FamilyName { get; set; }
        public string ContactNo { get; set; }
        public string ContactEmail { get; set; }
        public string Occupation { get; set; }
        public string Remarks { get; set; }
        public string GovermentProof { get; set; }

        public virtual EntityChurchMemberApplications Applications { get; set; }
        public virtual EntityChurch Church { get; set; }
        public virtual ICollection<EntityChurchMembers> ChurchMembers { get; set; }
        public virtual EntityChurchWorkerStatus CurrentStatus { get; set; }
        public virtual EntityChurchFamilyPresentAddress PresentAddress { get; set; }
        public virtual EntityChurchFamilyPermanentAddress PermanentAddress { get; set; }
    }
    /// <summary>
    /// Family Members Details
    /// </summary>
    [Table("CH_ChurchMember")]
    public class EntityChurchMembers : BaseEntity
    {
        [Key]
        public Guid MemberId { get; set; }
        public Guid FamilyId { get; set; }
        public Guid StatusId { get; set; }
        public Guid NameTitleId { get; set; }
        public Guid RelationShipId { get; set; }
        public int MemberNumber { get; set; }
        public string Initial { get; set; }
        public string FirstName { get; set; }
        public string MiddleName { get; set; }
        public string LastName { get; set; }
        public string FullName { get; set; }
        public int Gender { get; set; }
        public string Phone { get; set; }
        public string Email { get; set; }
        public string DateOfBirth { get; set; }
        public string DateOfDedication { get; set; }
        public string DateOfSalvation { get; set; }
        public string DateOfBaptism { get; set; }
        public string DateOfHgBaptism { get; set; }
        public string DateOfMarriage { get; set; }
        public string DateOfLeaving { get; set; }
        public string ReasonOfLeaving { get; set; }
        public string Remarks { get; set; }
        public bool IsGotBaptized { get; set; }
        public bool IsGotSalvation { get; set; }
        public bool IsGotMarried { get; set; }
        public bool IsGotHgBaptism { get; set; }
        public int CurrentAge { get; set; }
        public string Photo { get; set; }
        public string Occupation { get; set; }
        public string IdentityNumber { get; set; }
        public string GovermentProof { get; set; }
        public bool IsApplicant { get; set; }

        public virtual EntityNameTitle NameTitle { get; set; }
        public virtual EntityChurchMemberFamily Family { get; set; }
        public virtual EntityRelationShip RelationShip { get; set; }
        public virtual EntityChurchWorkerStatus ChurchWorkerStatus { get; set; }
        public virtual EntityChurchMemberBaptism Baptism { get; set; }
    }
    /// <summary>
    /// Family Present Address
    /// </summary>
    [Table("CH_ChurchMemberFamilyPresentAddress")]
    public class EntityChurchFamilyPresentAddress
    {
        [Key]
        public Guid PresentAddressId { get; set; }
        public Guid FamilyId { get; set; }
        public Guid? CountryId { get; set; }
        public Guid? StateId { get; set; }
        public string PresentAddress { get; set; }
        public string PresentCity { get; set; }
        public string PresentPinCode { get; set; }
        public bool IsSameAddress { get; set; }

        public virtual EntityCountry Country { get; set; }
        public virtual EntityStates State { get; set; }
        public virtual EntityChurchMemberFamily Family { get; set; }
    }
    /// <summary>
    /// Family PermanentAddress
    /// </summary>
    [Table("CH_ChurchMemberFamilyPermanentAddress")]
    public class EntityChurchFamilyPermanentAddress
    {
        [Key]
        public Guid PermanentAddressId { get; set; }
        public Guid FamilyId { get; set; }
        public Guid? CountryId { get; set; }
        public Guid? StateId { get; set; }
        public string PermanentCity { get; set; }
        public string PermanentAddress { get; set; }
        public string PermanentPincode { get; set; }
        
        public virtual EntityCountry Country { get; set; }
        public virtual EntityStates State { get; set; }
        public virtual EntityChurchMemberFamily Family { get; set; }
    }
    /// <summary>
    /// Family ChildDedication Details
    /// </summary>
    [Table("CH_ChurchMemberChildDedication")]
    public class EntityChurchFamilyChildDedications : BaseEntity
    {
        [Key]
        public Guid ChildDedicationId { get; set; }
        public Guid FamilyId { get; set; }
        public Guid ChurchWorkerId { get; set; }
        public string ChildName { get; set; }
        public bool IsGuardian { get; set; }
        public string GuardianDetails { get; set; }
        public string DateOfBirth { get; set; }
        public int Gender { get; set; }
        public string PlaceOfApplication { get; set; }
        public string DateOfApplication { get; set; }
        ///FOR OFFICE USE FIELDS
        public string DateOfRecivingApplication { get; set; }
        public string DateOfChildDedication { get; set; }
        public string PlaceOfChildDedication { get; set; }
        public string PhotoCopyOfBirthCertificate { get; set; }
        public string PhotoCopyOfApplication { get; set; }
        public string ImageOfChild { get; set; }
        /// <summary>
        /// 1.Approved
        /// 2.Pending
        /// 3.Rejected
        /// </summary>
        public int ApplicationStatus { get; set; }
        public string Reason { get; set; }

        public EntityChurch Church { get; set; }
        public EntityChurchMemberFamily Family { get; set; }
        public EntityChurchWorker ChurchWorker { get; set; }
    }
    /// <summary>
    /// Family Members Baptism Details
    /// </summary>
    [Table("CH_ChurchMemberBaptism")]
    public class EntityChurchMemberBaptism : BaseEntity
    {
        [Key]
        public Guid BaptismId { get; set; }
        public Guid ChurchId { get; set; }
        public Guid FamilyId { get; set; }
        public Guid MemberId { get; set; }
        public Guid ChurchWorkerId { get; set; }
        public string AttendingYears { get; set; }
        public string Notes { get; set; }
        public Guid BaptizerId { get; set; }
        public string DateOfBaptism { get; set; }
        public string PlaceOfBaptism { get; set; }
        public string PlaceOfApplication { get; set; }
        public string DateOfApplication { get; set; }
        public string ApplicationImage { get; set; }

        public virtual EntityChurch Church { get; set; }
        public virtual EntityChurchMemberFamily Family { get; set; }
        public virtual EntityChurchMembers Members { get; set; }
    }
    /// <summary>
    /// ChurchMemberJobtitle
    /// </summary>
    [Table("CH_ChurchMemberJobtitle")]
    public class EntityChurchMemberJobtitle : BaseEntity
    {
        [Key]
        public Guid ChurchMemberJobtitleId { get; set; }
        public Guid ChurchBoardId { get; set; }
        public Guid ChurchBoardJobtitleId { get; set; }
        public Guid ChurchId { get; set; }
        public Guid MemberId { get; set; }
        public int  EffectiveYear { get; set; }
        public string EffectiveFrom { get; set; }
        public string EffectiveTo { get; set; }
        public string Remarks { get; set; }
        public Guid CurrentStatusId { get; set; }
        public bool CreateLogin { get; set; }
        public string Email { get; set; }

        public virtual EntityChurch Church { get; set; }
        public virtual EntityChurchMembers Members { get; set; }
        public virtual EntityChurchBoardJobtitle BoardJobtitle { get; set; }
        public virtual EntityChurchJobtitleRole JobtitleRole { get; set; }
        public virtual EntityChurchBoard ChurchBoard { get; set; }
        public virtual EntityChurchWorkerStatus CurrentStatus { get; set; }
    }

}
